#include <iostream>
#include <string>
#include <set>

std::string s, t;

int main()
{
	std::getline(std::cin, s);
	std::getline(std::cin, t);
	std::set<char> all;
	for (auto ch : t) all.insert(ch);
	std::string ret;
	for (auto ch : s)
		if (all.find(ch) == all.end())
			ret += ch;
	std::cout << ret << '\n';
}

